{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "40f7d4fb",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c1f2ce6b",
   "metadata": {},
   "source": [
    "**Import Data**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dedb8549",
   "metadata": {},
   "outputs": [],
   "source": [
    "data=pd.read_csv(\"Additional Treatments Data/FourPerson.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "20a2726a",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(data[(data.Treatment==1)].Decision.mean()*40,data[(data.Treatment==2)].Decision.mean()*40)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d4eaa825",
   "metadata": {},
   "source": [
    "**Output**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9797164e",
   "metadata": {},
   "outputs": [],
   "source": [
    "#Leader in No Feedback where known score is less than or equal to 15\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest<=15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==2)].Decision.mean())\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest<=15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==6)].Decision.mean())\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest<=15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==0)].Decision.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f5693542",
   "metadata": {},
   "outputs": [],
   "source": [
    "#Leader in No Feedback where known score is above 15\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest>15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==2)].Decision.mean())\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest>15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==6)].Decision.mean())\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest>15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==0)].Decision.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0b1ba6ba",
   "metadata": {},
   "outputs": [],
   "source": [
    "#Follower in No Feedback where known score is less than or equal to 15\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest<=15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==2)].Decision.mean())\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest<=15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==6)].Decision.mean())\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest<=15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==0)].Decision.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "271dd14e",
   "metadata": {},
   "outputs": [],
   "source": [
    "#Follower in No Feedback where known score is above 15\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest>15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==2)].Decision.mean())\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest>15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==6)].Decision.mean())\n",
    "print(data[(data.Treatment==1)&(data.MyCurrentBest>15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==0)].Decision.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5b08e025",
   "metadata": {},
   "outputs": [],
   "source": [
    "#Leader in Feedback where known score less than or equal to 15\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest<=15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==2)].Decision.mean())\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest<=15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==6)].Decision.mean())\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest<=15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==0)].Decision.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "447afc9a",
   "metadata": {},
   "outputs": [],
   "source": [
    "#Leader in Feedback where known score above 15\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest>15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==2)].Decision.mean())\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest>15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==6)].Decision.mean())\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest>15)&(data.MyCurrentBest==data.CurrentBest)&(data.DecisionNumber%10==0)].Decision.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "aec45f92",
   "metadata": {},
   "outputs": [],
   "source": [
    "#Follower in Feedback where known score less than or equal to 15\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest<=15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==2)].Decision.mean())\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest<=15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==6)].Decision.mean())\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest<=15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==0)].Decision.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8ae90b87",
   "metadata": {},
   "outputs": [],
   "source": [
    "#Follower in Feedback where known score in above 15\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest>15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==2)].Decision.mean())\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest>15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==6)].Decision.mean())\n",
    "print(data[(data.Treatment==2)&(data.CurrentBest>15)&(data.MyCurrentBest<data.CurrentBest)&(data.DecisionNumber%10==0)].Decision.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a03737fa",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
